package cn.anlab.anappframe.demo.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import cn.anlab.anappframe.R;

public class DActivity extends Activity implements OnClickListener {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.demo_intent);
		
		Log.i("anlog", "D.onCreate()");
		
		TextView tv = (TextView) findViewById(R.id.textView1);
		tv.setText("DDDD");
		tv.setOnClickListener(this);		
		
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		Log.i("anlog", "D.onStart()");
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		Log.i("anlog", "D.onResume();");
	}
	
	@Override
	protected void onStop() {
		super.onStop();
		Log.i("anlog", "D.onStop();");
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		Log.i("anlog", "D.onPause();");
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		Log.i("anlog", "D.onDestroy();");
	}
	@Override
	public void onClick(View v) {
		Intent intent = new Intent();
		intent.setClass(this, BActivity.class);
//		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(intent);
	}

}
